<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
      <a-form-model ref="form" slot="detail" :model="model">
        <a-row>
          <a-col :span="24">
            <a-form-model-item label="">
              <fileUpload ref="fileUpload" @ok="modalFormOk"/>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </j-form-container>
  </a-spin>
</template>

<script>
  import fileUpload from './fileUpload'
  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  import {httpAction, getAction} from '@/api/manage'
  import columns from './columns'

  export default {
    name: 'AddVersionForm',
    components: {fileUpload},
    mixins: [JeecgListMixin],
    props: {
      // 表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      },
      versionDisabled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        columns: columns(),
        model: {},
        labelCol: {
          xs: {span: 24},
          sm: {span: 4}
        },
        wrapperCol: {
          xs: {span: 24},
          sm: {span: 20}
        },
        confirmLoading: false,
        disableMixinCreated: true,
      }
    },
    computed: {
      formDisabled() {
        return this.disabled
      }
    },
    created() {
    },
    methods: {
      add(record) {
        this.model = Object.assign({}, record)
        this.$refs.fileUpload.id = record.id
      },
      submitForm() {
        this.$emit('ok')
      }
    }
  }
</script>
<style scoped>
  .title {
    width: 19.5%;
    text-align: right;
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 15px;
    color: #3955a5;
  }

</style>
